package com.project.estate.changerdetail.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.project.estate.changerdetail.service.ChangerDetailService;
import com.project.estate.commons.bean.ChangeDetail;
import com.project.estate.commons.config.JsonResult;
import com.project.estate.commons.config.ResultTool;
import com.project.estate.commons.handler.ChangerDetailAddException;
import com.project.estate.commons.mapper.ChangerDetailMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class ChangerDetailServiceImpl extends ServiceImpl<ChangerDetailMapper, ChangeDetail> implements ChangerDetailService {



    @Override
    public JsonResult addchangerDetail(ChangeDetail changerdetail) {
        boolean b = save(changerdetail);
        log.info("表的数据changerdetail:{}", changerdetail);
        if (!b) {
            // 抛异常
            throw new ChangerDetailAddException("添加失败");
        }
        return ResultTool.success("success");
    }
}
